A subscriber identity module (SIM) card is also called a smart card or a subscriber identification card. The SIM card stores content such as information about a digital mobile phone subscriber, an encrypted key, and a telephone directory of the subscriber in a computer chip. The SIM card is a chip having a microprocessor and has five modules inside: a central processing unit (CPU), a program storage, a work storage, a data storage, and a serial communications unit; and the five modules are integrated in an integrated circuit. The SIM card mainly has the following functions.
(1) Storage of Subscriber-Related Data.
Data stored in the SIM card may be classified into four types. A first type is fixedly stored data, and this type of data is written by a SIM card center before a mobile equipment (ME) is sold, and includes an international mobile subscriber identification number (IMSI), an authentication key (Ki), and the like; a second type is temporarily stored network-related data, such as a location area identification (LAI), a temporary mobile subscriber identity (TMSI), and a code for a public telephone network forbidden to be accessed; a third type is a related service code, such as a personal identification number (PIN), a pin unblocking key (PUK), and a charging rate; and a fourth type is a phone directory, which includes a phone number entered by a mobile phone subscriber at any time.
(2) Subscriber PIN Operation and Management.
The SIM card is protected through a PIN, and the PIN is a personal password with four to eight digits. A SIM card can be enabled only when a subscriber enters a correct PIN, so that a mobile terminal can access the SIM card, and the subscriber can access a network and make a call only after authentication of the PIN succeeds.
(3) Subscriber Identity Authentication.
Subscriber identity authentication is implemented between a network and the SIM card. When the authentication begins, the network generates a 128-bit random number (Rand) and transmits the Rand through a radio control channel to a mobile station, and the SIM card computes, according to the key Ki and an algorithm A3 in the card, a signed response (SRES) to the received Rand, and then sends the result to a network end. The network end finds out a key Ki of the subscriber in an authentication center, computes an SRES using the same Rand and algorithm A3, and compares the SRES with the received SRES. If consistent, the authentication succeeds.
(4) Encryption Algorithms And Keys in the SIM Card.
Most sensitive data in the SIM card includes encryption algorithms A3 and A8 and keys Ki, PIN, PUK, and Kc. Algorithms A3 and A8 are written when a SIM card is produced and cannot be read. A PIN code can be set by a subscriber on a mobile phone, a PUK code is held by an operator, and Kc is exported by Ki during an encryption process.
The SIM card is organized around a processor and includes the following memories.
(1) A read only memory (ROM). The ROM is a program memory, has typical capacity of 16 thousand (K) bytes, and includes a development system of the SIM card, and the algorithms A3 and A8 (which may also be an algorithm A38) for dedicated use.
(2) An electrically erasable programmable read only memory (EEPROM). The EEPROM is a data memory and has typical capacity of 8K bytes. The EEPROM stores all normalized domains and related data for dedicated use in a global system of mobile communication (GSM).
(3) A random access memory (RAM). The RAM is a work memory. Capacity of the RAM may further be reduced and a typical value of the capacity is hundreds of bytes. The RAM includes related data for dedicated use.
The SIM card using the EEPROM can save information that is stored when a mobile phone is powered off and retrieve the information when necessary. As long as a user keeps the SIM card properly, the same identity can still be used even when the user changes a mobile phone.
A virtual SIM card technology is a technology in which an existing hardware SIM card is directly removed. A virtual SIM card refers to a manner in which a mobile network operator does not use a SIM card to bind a mobile phone number and a mobile terminal of a subscriber, but directly provides the mobile phone number.
However, the existing virtual SIM card technology supports standby of only one of a virtual SIM card and a hardware SIM card at a same time, but cannot support simultaneous standby of both the hardware SIM card and the virtual SIM card. That is, if a mobile terminal adopts a virtual SIM card, a hardware SIM card in the mobile terminal will be disabled; and in this way, when a subscriber that uses the mobile terminal uses the virtual SIM card, the subscriber cannot use the hardware SIM card for implementing a service, and cannot be contacted based on an identifier of the hardware SIM card either, so that it is greatly inconvenient for the subscriber to use the virtual SIM card.
The present disclosure provides a method and a terminal device for keeping a subscriber identity module card in a standby state, so as to implement simultaneous standby of a subscriber identity module card implemented on the basis of hardware and a subscriber identity module card implemented on the basis of software in a terminal device.
In one aspect, the present disclosure provides a method for keeping a subscriber identity module card in a standby state, which includes receiving, by a terminal device, an enabling request, where the enabling request is used for requesting simultaneous standby of a first subscriber identity module card and a second subscriber identity module card in the terminal device, the first subscriber identity module card is implemented on the basis of software, and the second subscriber identity module card is implemented on the basis of hardware; invoking, by the terminal device, a third-party invocation interface provided by an operating system of the terminal device; and performing interaction with a subscriber identity module card control module in the terminal device through a subscriber identity module mobile equipment function of the third-party invocation interface, so as to complete a network access process of the first subscriber identity module card on the basis of a data file of the first subscriber identity module card; and keeping, by the terminal device, the first subscriber identity module card and the second subscriber identity module card in a standby state at the same time according to the enabling request, where the second subscriber identity module card has already accessed a network.
In another aspect, the present disclosure provides a terminal device, which includes a first subscriber identity module card interface module and a subscriber identity module card control module, where the first subscriber identity module card interface module is configured to receive an enabling request, where the enabling request is used for requesting simultaneous standby of a first subscriber identity module card and a second subscriber identity module card in the terminal device, the first subscriber identity module card is implemented on the basis of software, and the second subscriber identity module card is implemented on the basis of hardware; invoke a third-party invocation interface provided by an operating system of the terminal device, so as to send the enabling request to the subscriber identity module card control module; and perform interaction with the subscriber identity module card control module through a subscriber identity module mobile equipment function of the third-party invocation interface, so as to complete a network access process of the first subscriber identity module card on the basis of a data file of the first subscriber identity module card; and the subscriber identity module card control module is configured to receive the enabling request sent by the first subscriber identity module card interface module; and keep the first subscriber identity module card and the second subscriber identity module card in a standby state at the same time according to the enabling request after the network access process of the first subscriber identity module card is completed, where the second subscriber identity module card has already accessed a network.
Technical effects of the present disclosure are that after receiving an enabling request for requesting simultaneous standby of a first subscriber identity module card implemented on the basis of software and a second subscriber identity module card implemented on the basis of hardware in a terminal device, the terminal device invokes a third-party invocation interface provided by an operating system of the terminal device; and performs interaction with a subscriber identity module card control module in the terminal device through a subscriber identity module mobile equipment function of the third-party invocation interface, so as to complete a network access process of the first subscriber identity module card on the basis of a data file of the first subscriber identity module card. Therefore, it can be seen that the network access process of the first subscriber identity module card is completed by interacting with the subscriber identity module card control module through the subscriber identity module mobile equipment function of the third-party invocation interface without using an interface between the second subscriber identity module card and the subscriber identity module card control module, and the network access process of the first subscriber identity module card does not influence a standby state of the second subscriber identity module card, so that the terminal device can keep the first subscriber identity module card and the second subscriber identity module card in a standby state at the same time according to the enabling request, where the second subscriber identity module card has already accessed a network, thereby implementing simultaneous standby of a subscriber identity module card implemented on the basis of hardware and a subscriber identity module card implemented on the basis of software in a terminal device. In this way, even if the terminal device uses the subscriber identity module card implemented on the basis of software, the subscriber identity module card implemented on the basis of hardware in the terminal device is kept in the standby state at the same time and is not disabled, so that a subscriber of the terminal device can still use the subscriber identity module card implemented on the basis of hardware for implementing a service, and can still be contacted through the subscriber identity module card implemented on the basis of hardware, thereby facilitating use of the subscriber.